﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebSiteAdminTool.Web.DataAccess.Interfaces;
using System.Web.Security;

namespace WebSiteAdminTool.Web.DataAccess
{
    public class MembershipDataAccess : BaseDataAccess, IMembershipDataAccess
    {
        #region overriden base methods

        public override string ApplicationName
        {
            get
            {
                return Membership.ApplicationName;
            }
        }

        #endregion

        //public bool UpdateRoleDescription(string roleName, string description)
        //{
        //    string applicationName = base.ApplicationName;

        //    using (var context = base.GetDataContext())
        //    {
        //        var currentRole = (from role in context.aspnet_Roles
        //                                where role.RoleName == roleName && role.aspnet_Applications.ApplicationName == applicationName
        //                                select role)
        //                                .FirstOrDefault();

        //        if (null != currentRole)
        //            currentRole.Description = description;

        //        if (context.SaveChanges() > 0)
        //            return true;

        //        return false;
        //    }
        //}
    }
}
